package com.yuntai.pms.model.enums;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author wangxiaoning@yuntai.com
 * @create 2019-01-28 10:20
 * @desc 角色类型数字对应的枚举类型
 **/
public enum RoleType {

    /**不能修改与删除，由系统通过脚本操作*/
    SYSTEM(1, "系统用色"),
    /**用户自定义*/
    CUSTOM(2, "用户自定义");
    private Integer code;
    private String name;

    private static Map<Integer,String> enumMap = new LinkedHashMap<>();

    static {
        enumMap.put(SYSTEM.getCode(),SYSTEM.getName());
        enumMap.put(CUSTOM.getCode(),CUSTOM.getName());
    }

    RoleType(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static Map<Integer, String> getEnumMap() { return enumMap; }
}
